package face.pay.web.oem.controller;

import face.pay.entity.OemConfigInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.util.ResultMessage;
import face.pay.web.oem.service.IOemConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zkj
 * @Date: 2019/8/12 13:11
 * @Description:
 */
@Controller
@RequestMapping("/oem_config")
public class OemConfigController {

    @Autowired
    IOemConfigService iOemConfigService;

    @RequestMapping("/info")
    public String oemConfig(@CurrentUser  UserInfo loginUser, Model model){

         this.iOemConfigService.getConfigInfo(loginUser,model);

         return  "oem/config";
    }

    @RequestMapping("/modify")
    @ResponseBody
    public ResultMessage modify(@CurrentUser UserInfo loginUser,OemConfigInfo oemConfigInfo){

        return  this.iOemConfigService.modify(oemConfigInfo,loginUser);

    }

}
